//	ID : pallab81
// 	PROG : ENCONDIN
// 	LANG : C++
// 	2011-07-04-00.29.58 Monday
//
// 	"I have not failed, I have just found 10000 ways that won't work.
//


#include <iostream>
#include <algorithm>
#include <vector>
#include <sstream>
#include <fstream>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>

#include <cstdio>
#include <cmath>
#include <cstring>
#include <climits>
#include <cstring>

using namespace std;

#define  CI( x ) scanf( "%d", &x )

#define VI vector<int>
#define VVI vector<VI >
#define VS vector<string>
#define VC vector<char>
#define VVC vector<VC >
#define VB vector<bool>
#define VVB vector<VB >
#define PAIR pair<int,int>
#define VP vector<PAIR >
#define fo(i,st,ed) for(int i = st; i < ed ; ++i)
#define foE(i,st,ed) for(int i = st; i <= ed ; ++i)
#define foit(i, x) for (typeof((x).begin()) i = (x).begin(); i != (x).end(); i++)
#define bip system("pause")
#define mk make_pair
#define f first
#define s second
#define pb push_back
#define SZ(X) (int)(X).size()
#define LN(X) (int)(X).length()
#define ll long long
#define IO ifstream cin(".in") ; ofstream cout(".out");

char ss[1000];
pair< int , char > vt[ 1000 ];

inline void doit() {
    int i;
    int n_size = 0;
    memset(vt,0,sizeof(vt));
    for( i = 0 ; i < strlen(ss) ;  ) {
        int tot=0;
        char ch = ss[i];

        while( ( i < strlen(ss) ) && ch==ss[i] ) {
            ++i;
            ++tot;
        }
        vt[ n_size ] =  mk(tot,ch) ;
        ++n_size;
    }
    for( i = 0 ; i < n_size ;   ) {
        if( vt[i].f>1 ) {
            if( vt[i].f <=9 ) {
                printf("%d%c",vt[i].f,vt[i].s);
                ++i;
            } else {
                printf("9%c",vt[i].s);
                vt[i].f-=9;
            }
        } else {

            printf("1");
            for( ; i < n_size && vt[i].f==1; ++i) {
                if( vt[i].s=='1') {
                    printf("1");
                }
                printf("%c",vt[i].s);

            }
            printf("1");
        }
    }
    printf("\n");
}

int main() {
    while( gets(ss) ) {
        doit();
    }

    return 0;
}

